﻿<Window x:Class="ResourceBlender_Express.WinTemplates"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:loc="clr-namespace:ResourceBlender_Express"
    loc:WindowService.EscapeClosesWindow="True"
    Loaded="Window_Loaded" WindowStartupLocation="CenterOwner"
    Title="Templates" Height="270" Width="300" MinHeight="270" MinWidth="300" MaxHeight="600" MaxWidth="600"
    Style="{StaticResource {x:Type Window}}" Icon="/ResourceBlender-Express;component/Resources/images/resourceblender.ico">
    <Window.CommandBindings>
        <CommandBinding Command="ApplicationCommands.Close" Executed="CloseWindow" />
        <CommandBinding Command="ApplicationCommands.New" Executed="AddTemplate" />
        <CommandBinding Command="ApplicationCommands.Help" Executed="ShowHelp" />
        <CommandBinding Command="loc:ResourceBlenderCommands.Edit" Executed="EditTemplate" CanExecute="CanExecuteEditTemplate" />
        <CommandBinding Command="loc:ResourceBlenderCommands.Delete" Executed="DeleteTemplate" CanExecute="CanExecuteDeleteTemplate" />
    </Window.CommandBindings>
    <DockPanel LastChildFill="True">
        <StatusBar DockPanel.Dock="Bottom" Height="24">
            <StatusBarItem x:Name="lblStatus" Visibility="Hidden">Loading</StatusBarItem>
            <StatusBarItem>
                <ProgressBar x:Name="prgStatus" IsIndeterminate="True" />
            </StatusBarItem>
        </StatusBar>
        <Grid DockPanel.Dock="Top" Margin="6">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <ListBox x:Name="lstTemplates" Grid.Row="0" Grid.Column="0" Grid.RowSpan="6" HorizontalAlignment="Stretch" VerticalContentAlignment="Top" 
                     ItemsSource="{Binding}" DisplayMemberPath="Name" MouseDoubleClick="EditTemplate" />

            <loc:ImageButton x:Uid="loc:ImageButton_1" Grid.Row="0" Grid.Column="1" Command="ApplicationCommands.New" Text="New" ImageLocation="Left" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left" Image="pack://application:,,,/Resources/images/template_add_16.png" ToolTip="Add a new template" AlwaysShowBorder="True" MinWidth="70" />
            <loc:ImageButton x:Uid="loc:ImageButton_2" Grid.Row="1" Grid.Column="1" Command="loc:ResourceBlenderCommands.Edit" Text="Edit" ImageLocation="Left" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left" Image="pack://application:,,,/Resources/images/template_edit_16.png" ToolTip="Edit template" AlwaysShowBorder="True" MinWidth="50" />
            <loc:ImageButton x:Uid="loc:ImageButton_3" Grid.Row="2" Grid.Column="1" Command="loc:ResourceBlenderCommands.Delete" Text="Delete" ImageLocation="Left" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left" Image="pack://application:,,,/Resources/images/template_delete_16.png" ToolTip="Delete template" AlwaysShowBorder="True" MinWidth="50" />

            <loc:ImageButton x:Uid="loc:ImageButton_4" Grid.Row="4" Grid.Column="1" Command="ApplicationCommands.Help" Text="Help" ImageLocation="Left" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left" Image="pack://application:,,,/Resources/images/question_16.png" AlwaysShowBorder="True" MinWidth="50" />
            <Button Grid.Row="5" Grid.Column="1" Command="ApplicationCommands.Close" MinWidth="70" IsCancel="True">Close</Button>
        </Grid>
    </DockPanel>
</Window>